#pragma once
#include "SaveInfoBase.hpp"
#include <string>
namespace PokerBoxSaveInfoServices
{
	class AppSettingSaveInfo : public SaveInfoBase
	{

	private:
		AppSettingSaveInfo() : SaveInfoBase("AppSetting.json")
		{
		}

		static AppSettingSaveInfo *Instance;

	protected:
		void OnDeserialize(nlohmann::json &json) override
		{
			this->Version = json["Version"];
		}

		void OnSerialize(nlohmann::json &json) override
		{
			json["Version"] = this->Version;
		}

	public:
		std::string Version;

		static AppSettingSaveInfo &GetInstance()
		{
			if (AppSettingSaveInfo::Instance == nullptr)
			{
				AppSettingSaveInfo::Instance = new AppSettingSaveInfo();
			}

			return (*AppSettingSaveInfo::Instance);
		}
	};

	AppSettingSaveInfo *AppSettingSaveInfo::Instance = nullptr;
}
